<script id="list-tpl" type="text/html" data-params='{"url":"/education/admin/user","pageid":"#page", "dataName":"userData"}'>
    <table id="example" class="layui-table lay-even" data-name="userData" data-tplid="list-tpl">
        <thead>
        <tr>
            <th width="30"><input type="checkbox" id="checkall" data-name="id" lay-filter="check"
                                      lay-skin="primary"></th>
            <th>账号</th>
            <th>昵称</th>
            <th width="70">性别</th>
            <th>角色</th>
            <th>签名</th>
            <th>加入时间</th>
            <th width="80">状态</th>
            <th>操作</th>
        </tr>
        </thead>
        <tbody>
        {{# layui.each(d.list, function(index, item){ }}
        <tr>
            <td><input type="checkbox" name="id" value="{{ item.id}}" lay-skin="primary"></td>
            <td>{{ item.username}}</td>
            <td>{{ item.name||''}}</td>
            <td>{{# if(item.sex == '1'){ }}男{{#  } }}
                {{# if(item.sex == '0'){ }}女{{#  } }}
                {{# if(item.sex == ''){ }}{{#  } }}
            </td>
            <td>{{ item.role_name||''}}</td>
            <td>{{ item.description}}</td>
            <td>{{ item.create_at}}</td>
            <td><input type="checkbox" name="status" lay-skin="switch" lay-text="启用|禁用" {{#if (item.status =='1'){
                }}checked="checked" {{# } }} lay-filter="ajax" value="1"
                data-params='{"url":"/education/admin/user/update","data":"id={{ item.id}}"}'/> </td>
            <td>
                <!--<button class="layui-btn layui-btn-mini modal-catch" beforeFun="beforeUpdate"
                        data-params='{"content": ".add-subcat","full":"true","title":"编辑{{= item.name}}", "key":"id={{item.id}}","data":"url=/education/admin/user/update","type":"1"}'>
                    <i class="iconfont">&#xe653;</i>编辑
                </button>-->
                <button class="layui-btn layui-btn-mini" onclick="_edit('{{item.id}}','{{item.mobile}}');">编辑</button>
                <button class="layui-btn layui-btn-mini modal-catch" beforeFun="beforeAddCharge"
                        data-params='{"content": ".edit-subcat","area":"500px,auto","title":"用户【{{= item.mobile}}】充值", "key":"id={{item.id}}","data":"url=/education/admin/user/charge","type":"1"}'>
                    充值
                </button>
                <button class="layui-btn layui-btn-mini modal-catch"
                        data-params='{"content": "#changeRole","area":"500px,auto","title":"用户【{{= item.mobile}}】角色修改", "key":"id={{item.id}}","data":"url=/education/admin/user/changeRole","type":"1"}'>
                    角色
                </button>
                <button class="layui-btn layui-btn-mini" onclick="_gotoOrder('{{item.id}}','{{item.mobile}}');">订单</button>
                <div class="tab-menu layui-btn layui-btn-mini">
                    <a href="javascript:;" data-url="module/user-next.html?uid={{item.id}}"
                       data-parent="true"
                       data-title="用户【{{item.username}}】下线管理">
                        <span style="color: white">下线</span>
                    </a>
                </div>

                <div class="tab-menu layui-btn layui-btn-mini">
                    <a href="javascript:;" data-url="module/address.html?uid={{item.id}}"
                       data-parent="true"
                       data-title="用户【{{item.username}}】地址管理">
                        <span style="color: white">地址</span>
                    </a>
                </div>
            </td>
        </tr>
        {{# }); }}
        </tbody>

    </table>
</script>